package com.learn.project2.config.customException;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @description: 认证异常、授权异常处理
 * @author zhizhuke
 * @date 2022-01-10 20-10
 * @version 1.0
 */
@ControllerAdvice
public class ExceptionControllerAdvise {

    /*@ExceptionHandler(AuthenticationException.class)
    public String handlerAuthenException(Exception e){

//        return "forward:/";
        return "redirect:/login.jsp";
    }
=======
        return "forward:/";
//        return "redirect:/index.jsp";
    }*/


    @ExceptionHandler(AuthorizationException.class)
    public String handlerAuthorException(Exception e){
        return "forward:/";
    }

}
